<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="./template/StakeholderTemplate.xhtml">
    <ui:define name="begin">
        <f:view beforePhase="#{stakeholderManagerBean.initPaymentManagementList}"></f:view>
    </ui:define>
    <ui:define name="contentInsert">

        <h:body>
            <h:form id="formMain">
                <h1>MyPrimeFacesOrganizer - Powered by PrimeFaces 2.2.1</h1>
                <p:menubar autoSubmenuDisplay="true">
                    <p:menuitem value="Home" url="index.xhtml" />
                    <p:menuitem value="TCubeView All Stakeholders" url="TCubeViewAllStakeholder.xhtml" />
                    <p:menuitem value="TCubeAdd New Stakeholder" url="StakeholderRegister.xhtml" />
                    <p:submenu label="Stakeholder Billing Management System">
                        <p:menuitem value="View all bills" url="StakeholderViewAllBills.xhtml" />
                    </p:submenu>
                </p:menubar>
                <br/>

                <p:panel id ="abc" header="View All Bills">
                    <p:dataTable var="paymentManagement" value="#{stakeholderManagerBean.paymentManagementList}" paginator="true"
                                 rows="12" emptyMessage="No bill has been sent to you">

                        <p:column sortBy="#{paymentManagement.id}" filterBy="#{paymentManagement.id}" filterMatchMode="contains">
                            <f:facet name="header">
                                <h:outputText value="Bill ID" />
                            </f:facet>
                            <h:outputText value="#{paymentManagement.id}" />
                        </p:column>

                        <p:column sortBy="#{paymentManagement.startDate}" filterBy="#{paymentManagement.startDate}" filterMatchMode="contains">
                            <f:facet name="header">
                                <h:outputText value="Start Date" />
                            </f:facet>
                            <h:outputText value="#{paymentManagement.startDate}" />
                        </p:column>

                        <p:column sortBy="#{paymentManagement.endDate}" filterBy="#{paymentManagement.endDate}" filterMatchMode="contains">
                            <f:facet name="header">
                                <h:outputText value="End Date" />
                            </f:facet>
                            <h:outputText value="#{paymentManagement.endDate}" />
                        </p:column>

                        <p:column sortBy="#{paymentManagement.totalPaymentCurrent}" filterBy="#{paymentManagement.totalPaymentCurrent}" filterMatchMode="contains">
                            <f:facet name="header">
                                <h:outputText value="Bill Amount" />
                            </f:facet>
                            <h:outputText value="#{paymentManagement.totalPaymentCurrent}" />
                        </p:column>

                        <p:column sortBy="#{paymentManagement.paymentReceived}" filterBy="#{paymentManagement.paymentReceived}" filterMatchMode="contains">
                            <f:facet name="header">
                                <h:outputText value="Amount Paid" />
                            </f:facet>
                            <h:outputText value="#{paymentManagement.paymentReceived}" />
                        </p:column>

                        <p:column sortBy="#{paymentManagement.paymentLeft}" filterBy="#{paymentManagement.paymentLeft}" filterMatchMode="contains">
                            <f:facet name="header">
                                <h:outputText value="Amount Left" />
                            </f:facet>
                            <h:outputText value="#{paymentManagement.paymentLeft}" />
                        </p:column>

                        <p:column sortBy="#{paymentManagement.dueDate}" filterBy="#{paymentManagement.dueDate}" filterMatchMode="contains">
                            <f:facet name="header">
                                <h:outputText value="Due Date" />
                            </f:facet>
                            <h:outputText value="#{paymentManagement.dueDate}" />
                        </p:column>
                    </p:dataTable>

                </p:panel>

            </h:form>
        </h:body>
    </ui:define>
</ui:composition>